package com.gjzhao.fmmall.service.feign;

import com.gjzhao.fmmall.entity.Orders;
import com.gjzhao.fmmall.vo.RespResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description: 订单发现服务Client
 * @Author: gjzhao
 * @Date Created in 2022-02-08 10:47 下午
 */
@FeignClient("order-add") //定义服务名字
public interface ApiOrderAddClient {

    /**
     * 添加订单服务
     * post传参时，如果有多个参数，非body部分必须使用 @RequestParam 注解进行声明
     * @param order
     * @param cartIds
     * @return
     */
    @PostMapping("orders/add")
    RespResultVO add(@RequestBody Orders order, @RequestParam("cartIds") String cartIds);

    /**
     * 查询订单服务
     *
     * @param orderId
     * @return
     */
    @GetMapping("orders/getOrder")
    RespResultVO getOrder(@RequestParam("orderId") String orderId);
}
